# @File : Xudu_lab.py
# @Author : xudu
# @Time : 2024/11/19



# modules you are allowed to import
import codon # this is my file with your codon dictionaries!
import numpy as np
import os

def read_FASTA(file_path):
    ''' Read FASTA file, output dict w/ all seqs keyed by name.
    
    Input: file path to FASTA file
    Output: dictionary with keys=sequence names (after
        > character) and values=corresponding
        amino acid or DNA sequence
    '''
    # use this example to learn how to read in files
    # Delete this once you understand how to read in files
    file_path = 'proteins_of_interest.txt'
    f = open(file_path,'r') # make sure proteins_of_interest.txt is saved in the same folder!
    flines = f.readlines()
    lineNum = 0
    for line in flines:
        lineNum += 1
        print('this is line: '+ str(lineNum))
        print(line)
    
    # return dictionary of seq name: sequence
    return {'Sequence Name':'ATTTACC....'}


def dna2protein(dnaSeq, codonTableD):
  '''Given a dnaSeq, output corresponding aa chain.

  Input: str of dnaSeq with len%3=0
         dict, codonTableD with keys=codon and vals=aa
  Output: str of amino acid sequence
  '''
  return ''


def findORFs(dnaSeq):
  '''Find all ORFs for given dnaSeq.

  Input dnaSeq: str of dnaSeq
  Output: list of strs (all unique orfs translated to aa seq)
  '''

  # Hint: you'll probably want to create a helper function or two (or more!) :)
  return ['']


if __name__ == '__main__':
    # replace with your own script
    print('I am so excited for this lab!')